/*
 * global_cb.h
 *
 *  Created on: 2013-2-5
 *      Author: panqiuhui
 */

#ifndef GLOBAL_CB_H_
#define GLOBAL_CB_H_

#include <gtk/gtk.h>
#include <stdbool.h>

enum {
	GLOBAL_WELCOME_BODY,
	LOGIN,
	MY_INFO_PERSONAL_INFO,
	MY_INFO_CHANGE_PASSWORD,
	MY_INFO_EDIT_PERSONAL_INFO,
	MY_ORDER_SEARCH_ORDER,
	MY_ORDER_REFUND_TICKET,
	BUY_TICKET,
	SEARCH_TICKET_LEFT,
	QUERY_SALETIME,
	SEARCH_TRAIN_INFO_TRAIN_NUMBER,
	SEARCH_TRAIN_INFO_START_END_STATION,
	SEARCH_TRAIN_INFO_STATION_PASS_TRAIN,
	REGISTER
};

//切换当前显示的窗口
void window_show(int windowshown);

//隐藏当前显示的窗口
void hide_current_window();

//处理工具栏中的用户退出的点击事件
void toolbutton_quit_clicked_cb(GtkToolButton *toolbutton, gpointer user_data);

//检查用户是否已经登录
bool check_is_login();

//设置标记表明用户已经登录
void set_login_flag(bool islogin);

//处理窗口关闭事件
void on_window_destroy(GtkWidget *window, gpointer user_data);

//显示信息窗口
void gtk_show_info(GtkWindow *window, const gchar* message_format,
		const gchar* message, const gchar* title);

//显示错误提示窗口
void gtk_show_error(GtkWindow *window, const gchar* message_format,
		const gchar* message, const gchar* title);

//显示询问窗口
bool gtk_show_question(GtkWindow *window, const gchar* message_format,
		const gchar* message, const gchar* title);

//显示警告窗口
void gtk_show_warning(GtkWindow *window, const gchar* message_format,
		const gchar* message, const gchar* title);

//处理日期输入框获得焦点的事件
void entry_focus_in_event_cb(GtkWidget *widget, GdkEvent *event,
		gpointer user_data);

//处理日期选择框的天的双击事件
void calendar_day_selected_double_click_cb(GtkCalendar *calendar,
		gpointer user_data);

//处理日期选择框失去焦点的事件
void calendar_focus_out_event_cb(GtkWidget *widget, GdkEvent *event,
		gpointer user_data);

#endif /* GLOBAL_CB_H_ */
